<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>My JSP 'pic.jsp' starting page</title>
    <script type="text/javascript">
    	function showNewPic(){
    		//C:\Users\Public\Pictures\Sample Pictures\Desert.jpg
    		
    		var showPath = document.getElementById("showPath");
    		
    		alert("路径="+showPath.value);
    		alert("加密路径="+window.URL.createObjectURL(showPath.files[0]));
    		
    		//document.getElementById("pic").src = "blob:38002CB2-6B4F-4B85-8831-136B47C90035";
    		document.getElementById("pic").src = window.URL.createObjectURL(showPath.files[0]);
    	
    	}
    </script>
  </head>
  
  <body>
  <img id="pic" alt="竞拍的商品" src="${pageContext.request.contextPath}/statics/images/img1.jpg" width="200" height="200">
  
   <input id="showPath" type="file" onchange="showNewPic()" />
  </body>
</html>
